#!/usr/bin/perl

use Encode;

my $src_file=$ARGV[0];
my $src_filter=".*\\.cpp\$|.*\\.c\$|.*\\.cc\$|.*\\.C\$|.*\\.tmpl\$|.*\\.impl\$";
my $svn_root="/qqspeed2010_server_proj/trunk/";
my $local_root="D:\\qqspeed2010_server_proj\\";
my $exclude="speedconf";


if(@ARGV < 1)
{
	print "usage:$0 input\n";
	exit 0;
}

my %del_map;
my %other_map;
open(src_file,"<",$src_file) or die "can't open file $src_file";
while(<src_file>)
{
	chomp;

	if($_ =~ $exclude)
	{
		next;
	}

	if($_ =~ /(.*) : (\/[^\s]+)/)
	{
		my $path=$2;
		my $op=$1;
		if($path =~ /$src_filter/)
		{
			$path =~ s/$svn_root/$local_root/;
			$path =~ s/\//\\/g;
			if($op ne Encode::decode('utf-8',"ÒÑÉ¾³ý"))
			{
				if(!defined $del_map{$path})
				{
					$other_map{$path} = $path;
				}
			}
			else
			{
                                if(!defined $other_map{$path})
                                {
                                        $del_map{$path} = $path;
                                }
			}
		}
	}
}

my @files=keys %other_map;
@files = sort @files;

foreach(@files)
{
	printf("%s\n",$_);
}
